<div class="ibox">
	<div class="ibox-content">
		<form method="post" class="form-horizontal" action="${cxt!}/cms/academyArticle/add" id="articleForm" >
			<div class="form-group">
				<div class="col-md-2"></div>
				<div class="col-md-1">
					<label>${_res["wealth.article.cover"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<div class="col-md-3">
					<div class="col-md-3 proimgfiles">
						<a href="javascript:void(0)" class="filesIconAdd" id="uploadproimgfiles">
							<!-- //ajax片段开始 -->
							<%  #ajax uploadproimgfiles: {%> 
								<% if(uploadFile! !=null) {%> 
									<input type="hidden" name="academyarticle.url" value="${uploadFile.path!}" /> 
									<img src="${imgCxt!}/${uploadFile.path!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
								<% } %> 
							<% } %>
							<!-- //ajax片段结尾 -->
						</a> 
						<input type="file" style="opacity: 0" id="fileuploadproimgfiles" name="url" />
					</div>
				</div>

				<div class="col-md-1">
					<label>${_res["wealth.article.englishcover"]}:<span class="fontColorRed">&nbsp;*</span></label>
				</div>
				<!-- 上传英文封面 -->
				<div class="col-md-3">
					<div class="col-md-3 proimgfiles">
						<a href="javascript:void(0)" class="filesIconAdd" id="uploadDatumFile">
							<!-- //ajax片段开始  -->
							<% #ajax uploadDatumFile: {%> 
								<% if (uploadFiles! != null) { %>
									<input type="hidden" name="academyarticle.urlen" value="${uploadFiles.path!}" />
									<img src="${imgCxt!}/${uploadFiles.path!}" width="100%" height="100%" style="position: relative; z-index: 99999;">
								<% } %>
							<% } %>
							<!-- //ajax片段结尾 -->
						</a> 
						<input type="file" style="opacity: 0" id="fileuploadDatumFile" name="urlen" />
					</div>
				</div>
			</div>
			<div class="hr-line-dashed"></div>

			<div class="form-group">
                <label class="col-md-2 control-label">${_res["wealth.college.articletitle"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-md-3">
                    <input type="text" class="form-control" name="academyarticle.title" required aria-required="true">
                </div>	   
                
	             <label class="col-md-2 control-label">${_res["wealth.college.englishtitle"]}:<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="academyarticle.titleen" required aria-required="true">
	             </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
			<div class="form-group">
                <label class="col-md-2 control-label">${_res["wealth.college.articlesubtitle"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-md-3">
                    <input type="text" class="form-control" name="academyarticle.subtitle" required aria-required="true">
                </div>	   
                
	             <label class="col-md-2 control-label">${_res["wealth.college.englishsubtitle"]}:<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="academyarticle.subtitleen" required aria-required="true">
	             </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-md-2 control-label">${_res["wealth.college.category"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-md-3">
                    <#dict type="select"  name="academyarticle.category" id="category" dictCode="ARTICLE_CLASSIFICATION" />
                </div>	   
                
	             <label class="col-md-2 control-label">${_res["wealth.college.subcategory"]}:<span class="fontColorRed">&nbsp;*</span></label>
	             <div id="divId" class="col-md-3">
	              	<% #ajax subcategory: {%>
						<select name="academyarticle.subcategory" class="form-control help-block m-b-none" >
							<%if(isEmpty(subcategoryList)){%>
								<option></option>
							<%}else{
								for(subcategory in subcategoryList){%>
									<option value="${subcategory.value!}">${subcategory.name!}</option>
							 <% }
							} %>
						</select>
					<% } %>
	             </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-md-2 control-label">${_res["wealth.college.posted"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-md-3">
                    <#dict type="radio"  name="academyarticle.posted" dictCode="ARTICLE_POSTED" />
                </div>	   
                
	             <label class="col-md-2 control-label">${_res["wealth.college.hot"]}:<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<#dict type="radio"  name="academyarticle.hot" dictCode="COMMON_YN" />
	             </div>	                  
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
                <label class="col-md-2 control-label">${_res["wealth.college.videourl"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-md-3">
                    <input type="text" class="form-control" name="academyarticle.videourl" required aria-required="true">
                </div>	
                 <label class="col-md-2 control-label">${_res["wealth.college.videourlen"]}:<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-md-3">
                    <input type="text" class="form-control" name="academyarticle.videourlen" required aria-required="true">
                </div>   
           </div>
          
           
           <div class="hr-line-dashed"></div>

			<div class="form-group">
				<label class="col-md-2 control-label">${_res["wealth.college.content"]}:<span class="fontColorRed">&nbsp;*</span></label>
				<div class="col-md-8">
					<script id="container" name="academyarticle.content" type="text/plain" style="width:100%; min-height:450px !important"></script>
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			
			<div class="form-group">
				<label class="col-md-2 control-label">${_res["wealth.college.englishcontent"]}:<span class="fontColorRed">&nbsp;*</span></label>
				<div class="col-md-8">
					<script id="container_english" name="academyarticle.contenten" type="text/plain" style="width:100%; min-height:450px !important"></script>
				</div>
			</div>
			
			<div class="form-group" style="margin-bottom:55px;">
				<div class="row">
					<div class="col-md-6">
						<label class="col-md-12 control-label "> 
							<% if(hasPrivilegeUrl("getAcademyarticleList")){ %>
								<button type="button" class="btn btn-warning" onClick="ajaxContent('/cms/academyArticle/list');">${_res["system.return"]}</button>
							<% } %> 
							<% if(hasPrivilegeUrl("academyArticleadd")){ %>
								<button type="submit" class="btn btn-primary"> ${_res["system.submit"]} </button> 
							<% } %> 
						</label>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>
<#submit formId="articleForm" divId="content" />

<script>
	$(document).ready(function() {
		var editor = new UE.ui.Editor();  
	    editor.render("container");
		
	    var editor_english = new UE.ui.Editor();  
	    editor_english.render("container_english");
		
		$("#category").on('change', function() {
			var category = $(this).val();
			var data = {toUrl : '/realty/academyarticle/add.html#subcategory', category : category};
			ajaxDiv('divId', '/cms/academyArticle/getsubcategory', data);
		});
		
		$("a[id^='upload']").on('click', function() {
			var id = $(this).attr("id");
			$("#file" + id).click();
		});
		
		// 选择文件之后执行上传ajaxFileUpload2(divId,fileElementId,toUrl,uploadType,uploadFiles,callback)
		$("input[id^='fileuploadproimgfiles']").on("change", function() {
			var fileElementId = $(this).attr("id");
			ajaxFileUpload2("uploadproimgfiles" , fileElementId , "/realty/academyarticle/add.html#uploadproimgfiles" , "academyArticle","uploadFile");
		});
		
		//上传英文封面  选择文件之后执行上传
		$("input[id^='fileuploadDatumFile'").on("change", function() {
			var fileElementId = $(this).attr("id");
			ajaxFileUpload2("uploadDatumFile",fileElementId,"/realty/academyarticle/add.html#uploadDatumFile","academyArticle","uploadFiles");
		});
	});
</script>